* Replication code for "Party origins, party infrastructural strength, and governance outcomes" in British Journal of Political Science
*  -- Qingjie Zeng, Fudan University

* Note: Unless otherwise noted, the following codes apply to the file named "Party infra strength BJPS_replication.dta". 


* Core tests, baseline models (Table 2)

  
global wlist v2paind v2padisa resource lnGDPcap lnpop civwar coup length_power i.Year

 
eststo clear
  
eststo: quietly  xtreg Dcalory Dcalory_l1 c.porsth##i.movep $wlist, fe vce(cluster ccode)
  
eststo: quietly  xtreg b_lifeex b_lifeex_l1 c.porsth##i.movep  $wlist, fe vce(cluster ccode)
  
eststo: quietly  xtreg infant_miller2015 infant_miller2015_l1 c.porsth##i.movep  $wlist, fe vce(cluster ccode)
   
eststo: quietly  xtreg b_growth b_growth_l1 c.porsth##i.movep  $wlist, fe vce(cluster ccode)
  
eststo: quietly xtreg  schooling2_miller2015 schooling_l1 c.porsth##i.movep  $wlist, fe vce(cluster ccode)

eststo: quietly xtreg hdi hdi_l1 c.porsth##i.movep  $wlist, fe vce(cluster ccode)
	
esttab, stats(N N_g g_max, labels("Obs" "Countries" "Max # Years")) b(3) se(3)  starlevels(* 0.10 ** 0.05 *** 0.01) legend label noconstant nogaps title(impact of PIP on governance  (baseline models))  drop(*.Year)


* Core tests, extensive models (Table 3)

 
global xlist resource lnGDPcap lnpop civwar coup length_power Capacity p_polity2 bizza_ps i.Year
  
eststo clear
  
eststo: quietly  xtreg Dcalory Dcalory_l1 c.porsth##i.movep $xlist, fe vce(cluster ccode)
  
eststo: quietly  xtreg b_lifeex b_lifeex_l1 c.porsth##i.movep  $xlist, fe vce(cluster ccode)
  
eststo: quietly  xtreg infant_miller2015 infant_miller2015_l1 c.porsth##i.movep  $xlist, fe vce(cluster ccode)
   
eststo: quietly  xtreg b_growth  b_growth_l1 c.porsth##i.movep  $xlist, fe vce(cluster ccode)
  
eststo: quietly xtreg  schooling2_miller2015 schooling_l1 c.porsth##i.movep  $xlist, fe vce(cluster ccode)

eststo: quietly xtreg hdi hdi_l1 c.porsth##i.movep  $xlist, fe vce(cluster ccode)
	
esttab, stats(N N_g g_max, labels("Obs" "Countries" "Max # Years")) b(3) se(3)  starlevels(* 0.10 ** 0.05 *** 0.01) legend label noconstant nogaps title(impact of PIP on governance (extensive models))   drop(*.Year)


 
* Robustness tests, dropping the lagged DVs (Table 1A, Appendix)
   
global wlist v2paind v2padisa resource lnGDPcap lnpop civwar coup length_power i.Year

 
eststo clear
  
eststo: quietly  xtreg Dcalory  c.porsth##i.movep $wlist, fe vce(cluster ccode)
  
eststo: quietly  xtreg b_lifeex  c.porsth##i.movep  $wlist , fe vce(cluster ccode)
  
eststo: quietly  xtreg infant_miller2015  c.porsth##i.movep  $wlist, fe vce(cluster ccode)
   
eststo: quietly  xtreg b_growth  c.porsth##i.movep  $wlist , fe vce(cluster ccode)
  
eststo: quietly xtreg  schooling2_miller2015  c.porsth##i.movep  $wlist, fe vce(cluster ccode)

eststo: quietly xtreg hdi  c.porsth##i.movep  $wlist , fe vce(cluster ccode)
	
esttab, stats(N N_g g_max, labels("Obs" "Countries" "Max # Years")) b(3) se(3)  starlevels(* 0.10 ** 0.05 *** 0.01) legend label noconstant nogaps title(Dropping the lagged DVs) drop(*.Year)

  
*  Measuring PIS as a stock variable (averaged over the past 2 years) (Table 2A, Appendix)

  
global wlist v2paind v2padisa resource lnGDPcap lnpop civwar coup length_power i.Year
  
eststo clear
  
eststo: quietly  xtreg Dcalory Dcalory_l1  c.pre2porsth##i.movep  $wlist, fe vce(cluster ccode)
  
eststo: quietly  xtreg b_lifeex b_lifeex_l1 c.pre2porsth##i.movep  $wlist, fe vce(cluster ccode)

eststo: quietly  xtreg infant_miller2015 infant_miller2015_l1 c.pre2porsth##i.movep  $wlist, fe vce(cluster ccode)
   
eststo: quietly  xtreg b_growth b_growth_l1 c.pre2porsth##i.movep  $wlist, fe vce(cluster ccode)

eststo: quietly xtreg schooling2_miller2015 schooling_l1  c.pre2porsth##i.movep  $wlist, fe vce(cluster ccode)

eststo: quietly xtreg hdi hdi_l1  c.pre2porsth##i.movep  $wlist, fe vce(cluster ccode)
	
esttab,  stats(N N_g g_max, labels("Obs" "Countries" "Max # Years")) b(3) se(3)  starlevels(* 0.10 ** 0.05 *** 0.01) legend label noconstant nogaps title(measuring PIS as a stock variable (averaged over the past 2 years) )  drop(*.Year)
  

*  Measuring PIS as a stock variable (averaged over the past 3 years) (Table 2B, Appendix)
  
eststo clear
  
eststo: quietly  xtreg Dcalory Dcalory_l1  c.pre3porsth##i.movep  $wlist, fe vce(cluster ccode)
  
eststo: quietly  xtreg b_lifeex b_lifeex_l1 c.pre3porsth##i.movep  $wlist, fe vce(cluster ccode)
  
eststo: quietly  xtreg infant_miller2015 infant_miller2015_l1 c.pre3porsth##i.movep  $wlist, fe vce(cluster ccode)
   
eststo: quietly  xtreg b_growth b_growth_l1 c.pre3porsth##i.movep  $wlist, fe vce(cluster ccode)

eststo: quietly xtreg schooling2_miller2015 schooling_l1  c.pre3porsth##i.movep  $wlist, fe vce(cluster ccode)

eststo: quietly xtreg hdi hdi_l1  c.pre3porsth##i.movep  $wlist, fe vce(cluster ccode)
	
esttab, stats(N N_g g_max, labels("Obs" "Countries" "Max # Years")) b(3) se(3)  starlevels(* 0.10 ** 0.05 *** 0.01) legend label noconstant nogaps title(measuring PIS as a stock variable (averaged over the past 3 years) )  drop(*.Year)
  
  
* Using the split-sample approach 
	  
* movement party regimes (Table 3A, Appendix)
	  
global wlist v2paind v2padisa resource lnGDPcap lnpop civwar coup length_power i.Year
	  
eststo clear
  
eststo: quietly  xtreg Dcalory Dcalory_l1 porsth $wlist if movep==1, fe vce(cluster ccode)
  
eststo: quietly  xtreg b_lifeex b_lifeex_l1 porsth $wlist if movep==1 , fe vce(cluster ccode)
  
eststo: quietly  xtreg infant_miller2015 infant_miller2015_l1 porsth $wlist if movep==1, fe vce(cluster ccode)
   
eststo: quietly  xtreg b_growth b_growth_l1 porsth $wlist if movep==1  , fe vce(cluster ccode)
  
eststo: quietly xtreg  schooling2_miller2015 schooling_l1 porsth $wlist if movep==1, fe vce(cluster ccode)

eststo: quietly xtreg hdi hdi_l1 porsth $wlist if movep==1 , fe vce(cluster ccode)
	
esttab, stats(N N_g g_max, labels("Obs" "Countries" "Max # Years")) b(3) se(3)  starlevels(* 0.10 ** 0.05 *** 0.01) legend label noconstant nogaps title(impact of PIP on governance: movement parties)  drop(*.Year)
  
  
* non-movement party regimes (Table 3B, Appendix)
  
eststo clear
  
eststo: quietly  xtreg Dcalory Dcalory_l1 porsth $wlist  if movep==0, fe vce(cluster ccode)
  
eststo: quietly  xtreg b_lifeex b_lifeex_l1 porsth $wlist  if movep==0  , fe vce(cluster ccode)
  
eststo: quietly  xtreg infant_miller2015 infant_miller2015_l1 porsth $wlist  if movep==0  , fe vce(cluster ccode)
   
eststo: quietly  xtreg b_growth b_growth_l1 porsth $wlist  if movep==0 , fe vce(cluster ccode)
  
eststo: quietly xtreg  schooling2_miller2015 schooling_l1 porsth $wlist  if movep==0  , fe vce(cluster ccode)

eststo: quietly xtreg hdi hdi_l1 porsth $wlist  if movep==0  , fe vce(cluster ccode)
	
esttab, stats(N N_g g_max, labels("Obs" "Countries" "Max # Years")) b(3) se(3)  starlevels(* 0.10 ** 0.05 *** 0.01) legend label noconstant nogaps title(impact of PIP on governance: non-movement parties) drop(*.Year)
  
  
  
* Rerun the main analysis using the dataset including partyless regimes (Table 4A, Appendix)

* For this test, use the file named "Party infra strength_replication_partyless_included.dta"

global wlist resource lnGDPcap lnpop length_power civwar coup i.Year
 
eststo clear
  
eststo: quietly  xtreg Dcalory Dcalory_l1 c.porsth##i.movep $wlist, fe vce(cluster ccode)
  
eststo: quietly  xtreg b_lifeex b_lifeex_l1 c.porsth##i.movep  $wlist, fe vce(cluster ccode)
  
eststo: quietly  xtreg infant_miller2015 infant_miller2015_l1 c.porsth##i.movep  $wlist, fe vce(cluster ccode)
    
eststo: quietly  xtreg b_growth b_growth_l1 c.porsth##i.movep  $wlist, fe vce(cluster ccode)
  
eststo: quietly xtreg  schooling2_miller2015 schooling_l1 c.porsth##i.movep  $wlist, fe vce(cluster ccode)

eststo: quietly xtreg hdi hdi_l1 c.porsth##i.movep  $wlist, fe vce(cluster ccode)
	
esttab, stats(N N_g g_max, labels("Obs" "Countries" "Max # Years")) b(3) se(3)  starlevels(* 0.10 ** 0.05 *** 0.01) legend label noconstant nogaps title(Full sample including party-less regimes) drop(*.Year)
  
  
  
* Using each of the three component of party infra strength as independent variable (Table 5A and 5B, Appendix)

* Return to the main file named "Party infra strength BJPS_replication.dta"
	  
global wlist v2paind v2padisa resource lnGDPcap lnpop civwar coup length_power i.Year

eststo clear
	  
eststo: quietly  xtreg  b_lifeex b_lifeex_l1 c.v2palocoff##i.movep  $wlist, fe vce(cluster ccode)
	  
eststo: quietly  xtreg  b_lifeex b_lifeex_l1 c.v2paactcom##i.movep  $wlist, fe vce(cluster ccode)

eststo: quietly  xtreg  b_lifeex b_lifeex_l1 c.v2pasoctie##i.movep  $wlist, fe vce(cluster ccode)
  
eststo: quietly  xtreg  schooling2_miller2015 schooling_l1 c.v2palocoff##i.movep $wlist, fe vce(cluster ccode)

eststo: quietly  xtreg  schooling2_miller2015 schooling_l1  c.v2paactcom##i.movep  $wlist, fe vce(cluster ccode)

eststo: quietly  xtreg schooling2_miller2015 schooling_l1  c.v2pasoctie##i.movep  $wlist, fe vce(cluster ccode)

esttab, stats(N N_g g_max, labels("Obs" "Countries" "Max # Years")) b(3) se(3)  starlevels(* 0.10 ** 0.05 *** 0.01) legend label noconstant nogaps title(Replacing PIS with each of its three components) drop(*.Year)

	  
eststo clear
	  
eststo: quietly  xtreg  infant_miller2015 infant_miller2015_l1  c.v2palocoff##i.movep  $wlist, fe  vce(cluster ccode)
	  
eststo: quietly  xtreg  infant_miller2015 infant_miller2015_l1 c.v2paactcom##i.movep  $wlist, fe vce(cluster ccode)

eststo: quietly  xtreg  infant_miller2015 infant_miller2015_l1  c.v2pasoctie##i.movep  $wlist, fe vce(cluster ccode)

eststo: quietly  xtreg  hdi hdi_l1 c.v2palocoff##i.movep  $wlist, fe vce(cluster ccode)

eststo: quietly  xtreg  hdi hdi_l1 c.v2paactcom##i.movep  $wlist, fe vce(cluster ccode)

eststo: quietly  xtreg  hdi hdi_l1 c.v2pasoctie##i.movep  $wlist, fe vce(cluster ccode)

esttab, stats(N N_g g_max, labels("Obs" "Countries" "Max # Years")) b(3) se(3)  starlevels(* 0.10 ** 0.05 *** 0.01) legend label noconstant nogaps title(Replacing PIS with each of its three components (continued)) drop(*.Year)
	  
	
	  
* The effect of party nationalization on governance, when permanent presence is low (Table 6A, Appendix)
	  
global wlist v2paind v2padisa resource lnGDPcap lnpop civwar coup length_power i.Year

	  
eststo clear
	   
eststo: quietly  xtreg  Dcalory Dcalory_l1 v2palocoff  $wlist if  v2paactcom<1.58 & movep==1, fe vce(cluster ccode)

eststo: quietly  xtreg  b_lifeex b_lifeex_l1 v2palocoff  $wlist if  v2paactcom<1.58 & movep==1, fe vce(cluster ccode)
		  
eststo: quietly  xtreg  infant_miller2015 infant_miller2015_l1 v2palocoff  $wlist if  v2paactcom<1.58 & movep==1, fe vce(cluster ccode)

eststo: quietly  xtreg  b_growth b_growth_l1 v2palocoff $wlist if  v2paactcom<1.58  & movep==1, fe vce(cluster ccode)

eststo: quietly  xtreg  schooling2_miller2015 schooling_l1  v2palocoff  $wlist if  v2paactcom<1.58 & movep==1, fe vce(cluster ccode)

eststo: quietly  xtreg  hdi hdi_l1 v2palocoff  $wlist if  v2paactcom<1.58 & movep==1, fe vce(cluster ccode)  
		  
esttab, stats(N N_g g_max, labels("Obs" "Countries" "Max # Years")) b(3) se(3)  starlevels(* 0.10 ** 0.05 *** 0.01) legend label noconstant nogaps title(The effects of party nationalization when permanent structures are lacking (movement party sample)) drop(*.Year)
		
		
* The effect of party permanent presence on governance, when nationalization is low (Table 6B, Appendix)
	  
eststo clear
	   
eststo: quietly  xtreg  Dcalory Dcalory_l1 v2paactcom  $wlist if  v2palocoff<1.690724  & movep==1, fe vce(cluster ccode)

eststo: quietly  xtreg  b_lifeex b_lifeex_l1  v2paactcom  $wlist if  v2palocoff<1.690724  & movep==1, fe vce(cluster ccode)
	  
eststo: quietly  xtreg  infant_miller2015 infant_miller2015_l1 v2paactcom  $wlist if  v2palocoff<1.690724   & movep==1, fe vce(cluster ccode)

eststo: quietly  xtreg  b_growth b_growth_l1 v2paactcom  $wlist if  v2palocoff<1.690724  & movep==1, fe vce(cluster ccode)

eststo: quietly  xtreg  schooling2_miller2015 schooling_l1  v2paactcom  $wlist if  v2palocoff<1.690724  & movep==1, fe vce(cluster ccode)
		  
eststo: quietly  xtreg  hdi hdi_l1  v2paactcom  $wlist if  v2palocoff<1.690724  & movep==1, fe vce(cluster ccode)

		  
		  
esttab, stats(N N_g g_max, labels("Obs" "Countries" "Max # Years")) b(3) se(3)  starlevels(* 0.10 ** 0.05 *** 0.01) legend label noconstant nogaps title(The effects of permanent structures when party nationalization is lacking (movement party sample)) drop(*.Year)
		
  
* Alternative explantion: party ideology (Table 7A, Appendix)

global wlist v2paind v2padisa resource lnGDPcap lnpop civwar coup length_power i.Year

  
eststo clear

  
eststo: quietly xtreg Dcalory Dcalory_l1 c.v2pariglef##c.porsth $wlist, fe vce(cluster ccode)
  
eststo: quietly xtreg b_lifeex b_lifeex_l1   c.v2pariglef##c.porsth $wlist , fe vce(cluster ccode)
  
eststo: quietly xtreg infant_miller2015 infant_miller2015_l1   c.v2pariglef##c.porsth  $wlist, fe vce(cluster ccode)
  
eststo: quietly xtreg b_growth b_growth_l1  c.v2pariglef##c.porsth $wlist, fe vce(cluster ccode)
  
eststo: quietly xtreg schooling2_miller2015 schooling_l1  c.v2pariglef##c.porsth  $wlist, fe vce(cluster ccode)

eststo: quietly xtreg hdi hdi_l1  c.v2pariglef##c.porsth $wlist, fe vce(cluster ccode)

 
esttab, stats(N N_g g_max, labels("Obs" "Countries" "Max # Years")) b(3) se(3)   starlevels(* 0.10 ** 0.05 *** 0.01) legend label noconstant nogaps title(Interaction between party ideology and PIS) drop(*.Year)
  
  
* Using only movement parties with right-wing ideology (Table 7B, Appendix)
  
eststo clear
  
eststo: quietly   xtreg Dcalory Dcalory_l1 c.porsth##i.movep  $wlist if v2pariglef>-0.676318 , fe vce(cluster ccode)
  
eststo: quietly  xtreg b_lifeex b_lifeex_l1  c.porsth##i.movep  $wlist if v2pariglef>-0.676318 , fe vce(cluster ccode)
  
eststo: quietly  xtreg infant_miller2015 infant_miller2015_l1 c.porsth##i.movep  $wlist if v2pariglef>-0.676318 , fe vce(cluster ccode)
   
eststo: quietly  xtreg b_growth b_growth_l1 c.porsth##i.movep  $wlist if v2pariglef>-0.676318 , fe vce(cluster ccode)

eststo: quietly xtreg schooling2_miller2015 schooling_l1 c.porsth##i.movep  $wlist if v2pariglef>-0.676318 , fe vce(cluster ccode)

eststo: quietly xtreg hdi hdi_l1  c.porsth##i.movep  $wlist if v2pariglef>-0.676318 , fe vce(cluster ccode)
	
esttab, stats(N N_g g_max, labels("Obs" "Countries" "Max # Years")) b(3) se(3)  starlevels(* 0.10 ** 0.05 *** 0.01) legend label noconstant nogaps title(The effects of PIS on governance for right-wing parties) drop(*.Year)
  
  
  
*  Predicting governance with the first year PIS, using cross-sectional data (Table 8A, Appendix)
  
* For this test, use the file named "Party infra strength_replication_BJPS_cross-sectional".
  
global xlist resource lnGDPcap lnpop Capacity p_polity2 

eststo clear

eststo: quietly  reg Dcalory porsth_y1 Dcalorym $xlist, vce(robust)
  
eststo: quietly  reg b_lifeex porsth_y1 b_lifeexm $xlist, vce(robust)

eststo: quietly reg infant_miller2015 porsth_y1 infantm $xlist, vce(robust)
	  
eststo: quietly reg b_growth porsth_y1 b_growthm $xlist, vce(robust)
   
eststo: quietly reg schooling2_miller2015 porsth_y1 schoolingm $xlist, vce(robust)

eststo: quietly reg hdi porsth_y1 hdim $xlist, vce(robust)
  
  
esttab, stats(N r2_a, labels("Obs" "adjusted r-squared")) b(3) se(3)  starlevels(* 0.10 ** 0.05 *** 0.01) legend label noconstant nogaps 
  
  
  
* Testing causal mechanism: how movement party affects people-centerism (Table 9A, Appendix)
  
* For this test, use the file named "Party infra strength_replication_BJPS_cross-sectional".

eststo clear
 
eststo: quietly reg v2papeople movep, vce(robust)
  
eststo: quietly reg v2papeople movep lnGDPcap lnpop v2paind v2padisa, vce(robust)
  
esttab, stats(N r2_a, labels("Obs" "adjusted r-squared")) b(3) se(3)  starlevels(* 0.10 ** 0.05 *** 0.01) legend label noconstant nogaps title(People-centered rhetoric: movement party vs. non-movement party)


* Cross-nationally, parties with more people-centerism tend to have better outcomes (Table 9B, Appendix)

* For this test, use the file named "Party infra strength_replication_BJPS_cross-sectional".

  
eststo clear


eststo: quietly reg Dcalory v2papeople lnGDPcap lnpop p_polity2, vce(robust)

eststo: quietly reg b_lifeex v2papeople lnGDPcap lnpop p_polity2, vce(robust) 
 
eststo: quietly reg infant_miller2015 v2papeople lnGDPcap lnpop p_polity2, vce(robust) 

eststo: quietly reg b_growth v2papeople lnGDPcap lnpop p_polity2, vce(robust) 

eststo: quietly reg schooling2_miller2015 v2papeople lnGDPcap lnpop p_polity2, vce(robust) 

eststo: quietly reg hdi v2papeople lnGDPcap lnpop p_polity2, vce(robust) 

esttab, stats(N r2_a, labels("Obs" "adjusted r-squared")) b(3) se(3)  starlevels(* 0.10 ** 0.05 *** 0.01) legend label noconstant nogaps title(The effects of people-centered rhetoric on governance)


* Showing that the importance of movement party declines with length in power (Table 9C, Appendix)

* Return to the main file named "Party infra strength BJPS_replication.dta"

eststo clear

global wlist v2paind v2padisa resource lnGDPcap lnpop civwar coup i.Year
 
eststo: quietly  xtreg  v2papeople i.movep##c.length_power $wlist, re vce(cluster ccode)

eststo: quietly  xtreg  v2papeople i.movep##c.length_power $wlist, fe vce(cluster ccode)

esttab, stats(N N_g g_max, labels("Obs" "Countries" "Max # Years")) b(3) se(3)  starlevels(* 0.10 ** 0.05 *** 0.01) legend label noconstant nogaps title(How the effect of movement party on people-centered rhetoric changes over time) drop(*.Year)
  
  
** figure 3 
  
eststo: quietly  xtreg Dcalory  Dcalory_l1 c.porsth##i.movep  $wlist, fe vce(cluster ccode)

margins, dydx(porsth) at(movep==0) at(movep==1)
  
eststo: quietly  xtreg b_lifeex b_lifeex_l1 c.porsth##i.movep  $wlist, fe vce(cluster ccode)

margins, dydx(porsth) at(movep==0) at(movep==1)
  
eststo: quietly  xtreg infant_miller2015 infant_miller2015_l1 c.porsth##i.movep  $wlist, fe vce(cluster ccode)
  
margins, dydx(porsth) at(movep==0) at(movep==1)

eststo: quietly  xtreg b_growth  b_growth_l1 c.porsth##i.movep  $wlist, fe vce(cluster ccode)

margins, dydx(porsth) at(movep==0) at(movep==1)
  
eststo: quietly xtreg  schooling2_miller2015 schooling_l1 c.porsth##i.movep  $wlist, fe vce(cluster ccode)
  
margins, dydx(porsth) at(movep==0) at(movep==1)

eststo: quietly xtreg hdi hdi_l1 c.porsth##i.movep  $wlist, fe vce(cluster ccode)

margins, dydx(porsth) at(movep==0) at(movep==1)

  
marginsplot, yline(0) recast(scatter) xscale(range(0.5 2.5))  xlabel(1 "movement party=0" 2 "movement party=1"  )
  
  
gr combine   "/Users/pro/Library/Mobile Documents/com~apple~CloudDocs/political science/my projects/party strength and political stability/graphs/Heterogeneous causal effects (calory).gph""/Users/pro/Library/Mobile Documents/com~apple~CloudDocs/political science/my projects/party strength and political stability/graphs/Heterogeneous effects (life).gph""/Users/pro/Library/Mobile Documents/com~apple~CloudDocs/political science/my projects/party strength and political stability/graphs/Heterogeneous causal effects (infant).gph""/Users/pro/Library/Mobile Documents/com~apple~CloudDocs/political science/my projects/party strength and political stability/graphs/Heterogeneous causal effects (growth).gph""/Users/pro/Library/Mobile Documents/com~apple~CloudDocs/political science/my projects/party strength and political stability/graphs/Heterogeneous causal effects (school).gph""/Users/pro/Library/Mobile Documents/com~apple~CloudDocs/political science/my projects/party strength and political stability/graphs/Heterogeneous causal effects (hdi).gph",  iscale(.8) xcommon
